﻿using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

using Ajeelee.Core.Database;
using Ajeelee.Core.Utils;
using BoCaiWeb.Business;
using BoCaiWeb.Model;
using BoCaiWeb.WebSite.Code;

namespace BoCaiWeb.WebSite
{
    public partial class productlist : PageBase
    {
        Hashtable table = new Hashtable();
        protected IList<Products> productsList = new List<Products>();
        IProductsBusiness productsBll = new ProductsBusinessFactory().CreateProductsBusiness();
        protected PageStructure ps = new PageStructure() { CurrPage = 1, PageSize = 6 };

        protected void Page_Load(object sender, EventArgs e)
        {
            // 接收参数
            if (QueryParamInt32("page") > 1)
            {
                ps.CurrPage = QueryParamInt32("page");
            }

            try
            {
                // 读取分页数据
                productsList = productsBll.GetAllProductsByPage(table, ps);
                this.pager.PageStruct = ps;
            }
            catch (Exception ex)
            {
                Function.WriteErrorLog(ex);
            }
        }
    }
}